package com.yxx.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 搜索模式枚举
 * @author yuxiangxun
 * @date 2025/3/2
 * @apiNote
 */
@Getter
@AllArgsConstructor
public enum SearchModeEnum {

    /**
     * MySQL
     */
    MYSQL("mysql","mysqlSearchStrategyImpl"),

    /**
     * elasticsearch
     */
    ELASTICSEARCH("elasticsearch","elasticSearchSearchStrategyImpl");

    /**
     * 模式
     */
    private final String mode;

    /**
     * 策略
     */
    private final String strategy;

    public static String getSearchModeStrategy(String mode){
        for(SearchModeEnum searchModeEnum : SearchModeEnum.values()){
            if(searchModeEnum.getMode().equals(mode)){
                return searchModeEnum.getStrategy();
            }
        }
        return null;
    }
}
